home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1994 January / PSL Monthly Shareware CD-ROM (Public Software Library) (January 1994).iso / win / bmplst.zip / SAMPLE.ZIP / BMPLST.FRM next >
Text File  |  1993-06-29  |  9KB  |  309 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BackColor       =   &H00FFFFFF&
  4.    Caption         =   "BmpLst Sample"
  5.    ClientHeight    =   4815
  6.    ClientLeft      =   1470
  7.    ClientTop       =   1785
  8.    ClientWidth     =   4695
  9.    ControlBox      =   0   'False
  10.    Height          =   5220
  11.    Left            =   1410
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   4815
  16.    ScaleWidth      =   4695
  17.    Top             =   1440
  18.    Width           =   4815
  19.    Begin TextBox Text1 
  20.       Enabled         =   0   'False
  21.       Height          =   285
  22.       Left            =   2880
  23.       TabIndex        =   11
  24.       Top             =   2280
  25.       Width           =   1575
  26.    End
  27.    Begin CommandButton Command3 
  28.       Caption         =   "Remove Item"
  29.       Enabled         =   0   'False
  30.       Height          =   375
  31.       Left            =   2880
  32.       TabIndex        =   10
  33.       Top             =   1200
  34.       Width           =   1575
  35.    End
  36.    Begin CommandButton Command2 
  37.       Caption         =   "Add Item"
  38.       Enabled         =   0   'False
  39.       Height          =   375
  40.       Left            =   2880
  41.       TabIndex        =   9
  42.       Top             =   720
  43.       Width           =   1575
  44.    End
  45.    Begin CommandButton Command1 
  46.       Caption         =   "Exit"
  47.       Height          =   375
  48.       Left            =   2880
  49.       TabIndex        =   8
  50.       Top             =   240
  51.       Width           =   1575
  52.    End
  53.    Begin Frame Frame1 
  54.       Caption         =   "Item Image"
  55.       Height          =   1815
  56.       Left            =   240
  57.       TabIndex        =   1
  58.       Top             =   2760
  59.       Width           =   2415
  60.       Begin PictureBox Picture1 
  61.          BorderStyle     =   0  'None
  62.          Height          =   495
  63.          Index           =   0
  64.          Left            =   240
  65.          Picture         =   BMPLST.FRX:0000
  66.          ScaleHeight     =   495
  67.          ScaleWidth      =   495
  68.          TabIndex        =   7
  69.          Top             =   360
  70.          Width           =   495
  71.       End
  72.       Begin PictureBox Picture1 
  73.          BorderStyle     =   0  'None
  74.          Height          =   495
  75.          Index           =   1
  76.          Left            =   240
  77.          Picture         =   BMPLST.FRX:0302
  78.          ScaleHeight     =   495
  79.          ScaleWidth      =   495
  80.          TabIndex        =   6
  81.          Top             =   1080
  82.          Width           =   495
  83.       End
  84.       Begin PictureBox Picture1 
  85.          BorderStyle     =   0  'None
  86.          Height          =   495
  87.          Index           =   2
  88.          Left            =   960
  89.          Picture         =   BMPLST.FRX:0604
  90.          ScaleHeight     =   495
  91.          ScaleWidth      =   495
  92.          TabIndex        =   5
  93.          Top             =   360
  94.          Width           =   495
  95.       End
  96.       Begin PictureBox Picture1 
  97.          BorderStyle     =   0  'None
  98.          Height          =   495
  99.          Index           =   3
  100.          Left            =   960
  101.          Picture         =   BMPLST.FRX:0906
  102.          ScaleHeight     =   495
  103.          ScaleWidth      =   495
  104.          TabIndex        =   4
  105.          Top             =   1080
  106.          Width           =   495
  107.       End
  108.       Begin PictureBox Picture1 
  109.          BorderStyle     =   0  'None
  110.          Height          =   495
  111.          Index           =   4
  112.          Left            =   1680
  113.          Picture         =   BMPLST.FRX:0C08
  114.          ScaleHeight     =   495
  115.          ScaleWidth      =   495
  116.          TabIndex        =   3
  117.          Top             =   360
  118.          Width           =   495
  119.       End
  120.       Begin PictureBox Picture1 
  121.          BorderStyle     =   0  'None
  122.          Height          =   495
  123.          Index           =   5
  124.          Left            =   1680
  125.          Picture         =   BMPLST.FRX:0F0A
  126.          ScaleHeight     =   495
  127.          ScaleWidth      =   495
  128.          TabIndex        =   2
  129.          Top             =   1080
  130.          Width           =   495
  131.       End
  132.       Begin Shape Shape1 
  133.          BorderStyle     =   0  'Transparent
  134.          FillColor       =   &H00FFFFFF&
  135.          FillStyle       =   0  'Solid
  136.          Height          =   735
  137.          Index           =   0
  138.          Left            =   120
  139.          Top             =   240
  140.          Width           =   735
  141.       End
  142.       Begin Shape Shape1 
  143.          BorderStyle     =   0  'Transparent
  144.          FillColor       =   &H00FFFFFF&
  145.          FillStyle       =   0  'Solid
  146.          Height          =   735
  147.          Index           =   1
  148.          Left            =   120
  149.          Top             =   960
  150.          Width           =   735
  151.       End
  152.       Begin Shape Shape1 
  153.          BorderStyle     =   0  'Transparent
  154.          FillColor       =   &H00FFFFFF&
  155.          FillStyle       =   0  'Solid
  156.          Height          =   735
  157.          Index           =   2
  158.          Left            =   840
  159.          Top             =   240
  160.          Width           =   735
  161.       End
  162.       Begin Shape Shape1 
  163.          BorderStyle     =   0  'Transparent
  164.          FillColor       =   &H00FFFFFF&
  165.          FillStyle       =   0  'Solid
  166.          Height          =   735
  167.          Index           =   3
  168.          Left            =   840
  169.          Top             =   960
  170.          Width           =   735
  171.       End
  172.       Begin Shape Shape1 
  173.          BorderStyle     =   0  'Transparent
  174.          FillColor       =   &H00FFFFFF&
  175.          FillStyle       =   0  'Solid
  176.          Height          =   735
  177.          Index           =   4
  178.          Left            =   1560
  179.          Top             =   240
  180.          Width           =   735
  181.       End
  182.       Begin Shape Shape1 
  183.          BorderStyle     =   0  'Transparent
  184.          FillColor       =   &H00FFFFFF&
  185.          FillStyle       =   0  'Solid
  186.          Height          =   735
  187.          Index           =   5
  188.          Left            =   1560
  189.          Top             =   960
  190.          Width           =   735
  191.       End
  192.    End
  193.    Begin BmpList BmpList1 
  194.       BorderEffect    =   0  'None
  195.       BorderStyle     =   1  'Fixed Single
  196.       BottomMargin    =   60
  197.       Height          =   2415
  198.       Left            =   240
  199.       MultiSelect     =   0  'None
  200.       Sorted          =   0   'False
  201.       TabIndex        =   0
  202.       Top             =   240
  203.       TopMargin       =   30
  204.       VertGap         =   30
  205.       Width           =   2415
  206.    End
  207.    Begin Label Label1 
  208.       Caption         =   "Item Text:"
  209.       Enabled         =   0   'False
  210.       Height          =   255
  211.       Left            =   2880
  212.       TabIndex        =   12
  213.       Top             =   2040
  214.       Width           =   1215
  215.    End
  216. End
  217. Dim CurIndex As Integer
  218.  
  219. Sub BmpList1_Click ()
  220.     Dim I As Integer
  221.  
  222.     If BmpList1.ListCount = 0 Then
  223.         Command3.Enabled = False
  224.         Exit Sub
  225.     End If
  226.  
  227.     Command3.Enabled = True
  228.     If CurIndex <> -1 Then
  229.         Picture1(CurIndex).BackColor = &HFFFFFF
  230.         Shape1(CurIndex).FillColor = &HFFFFFF
  231.         CurIndex = -1
  232.     End If
  233.  
  234.     For I = 0 To 5
  235.         If Picture1(I).Picture = BmpList1.Picture(BmpList1.ListIndex) Then
  236.             CurIndex = I
  237.  
  238.             Picture1(CurIndex).BackColor = &HC0C0C0
  239.             Shape1(CurIndex).FillColor = &HC0C0C0
  240.             Exit For
  241.         End If
  242.     Next I
  243.  
  244.     Text1.Text = BmpList1.List(BmpList1.ListIndex)
  245. End Sub
  246.  
  247. Sub Command1_Click ()
  248.     End
  249. End Sub
  250.  
  251. Sub Command2_Click ()
  252.     ' BmpList1.ScreenUpdate = False
  253.     BmpList1.AddItem Text1
  254.     BmpList1.Picture(BmpList1.NewIndex) = Picture1(CurIndex).Picture
  255.     BmpList1.ScreenUpdate = True
  256. End Sub
  257.  
  258. Sub Command3_Click ()
  259.     BmpList1.RemoveItem BmpList1.ListIndex
  260.  
  261.     If BmpList1.ListCount = 0 Then
  262.         Command3.Enabled = False
  263.         BmpList1.ListIndex = 0
  264.     ElseIf BmpList1.ListIndex >= BmpList1.ListCount Then
  265.         BmpList1.ListIndex = BmpList1.ListCount - 1
  266.     End If
  267. End Sub
  268.  
  269. Sub Form_Load ()
  270.     CurIndex = -1
  271. End Sub
  272.  
  273. Sub Picture1_Click (Index As Integer)
  274.     If CurIndex <> -1 Then
  275.         Shape1(CurIndex).FillColor = &HFFFFFF
  276.         Picture1(CurIndex).BackColor = &HFFFFFF
  277.     End If
  278.  
  279.     If CurIndex = Index Then
  280.         CurIndex = -1
  281.         Command2.Enabled = False
  282.         Label1.Enabled = False
  283.         Text1.Enabled = False
  284.  
  285.         If BmpList1.ListCount > 0 Then
  286.             BmpList1.Picture(BmpList1.ListIndex) = Null
  287.         End If
  288.     Else
  289.         Command2.Enabled = True
  290.         Text1.Enabled = True
  291.         Label1.Enabled = True
  292.         CurIndex = Index
  293.  
  294.         Picture1(Index).BackColor = &HC0C0C0
  295.         Shape1(Index).FillColor = &HC0C0C0
  296.  
  297.         If BmpList1.ListCount > 0 Then
  298.             BmpList1.Picture(BmpList1.ListIndex) = Picture1(Index).Picture
  299.         End If
  300.     End If
  301. End Sub
  302.  
  303. Sub Text1_Change ()
  304.     If BmpList1.ListCount > 0 Then
  305.         BmpList1.List(BmpList1.ListIndex) = Text1.Text
  306.     End If
  307. End Sub
  308.  
  309.